import 'package:flutter/material.dart';
import 'package:get/get.dart';

class OpenBox extends StatefulWidget {
  const OpenBox({super.key});

  @override
  State<OpenBox> createState() => _SettingPageState();
}

class _SettingPageState extends State<OpenBox> {
  final thumb = Get.parameters['thumb'];
  final title = Get.parameters['title'];
  final updatedat = Get.parameters['updated_at'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          SizedBox(height: 60),
          ClipRRect(
            borderRadius: BorderRadius.circular(11.0), // 设置圆角大小
            child: Image.network(
              thumb!,
              width: 200,
              height: 200,
              fit: BoxFit.fill,
            ),
          ),
          SizedBox(height: 15),

          Text(
            '开盒获得',
            style: TextStyle(fontSize: 15, color: Color(0XFF0F172B)),
          ),
          SizedBox(height: 25),

          Container(
            margin: EdgeInsets.symmetric(horizontal: 15),
            padding: EdgeInsets.symmetric(horizontal: 15, vertical: 15),
            decoration: BoxDecoration(
              color: Color(0XFFF8F9FD),
              borderRadius: BorderRadius.circular(5),
            ),
            child: Column(
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '藏品名称',
                      style: TextStyle(fontSize: 14, color: Color(0XFF999999)),
                    ),
                    Text(
                      '$title',
                      style: TextStyle(fontSize: 14, color: Color(0XFF0F172B)),
                    ),
                  ],
                ),
                SizedBox(height: 20),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '获得数量',
                      style: TextStyle(fontSize: 14, color: Color(0XFF999999)),
                    ),
                    Text(
                      '1',
                      style: TextStyle(fontSize: 14, color: Color(0XFF0F172B)),
                    ),
                  ],
                ),
                SizedBox(height: 20),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '开盒时间',
                      style: TextStyle(fontSize: 14, color: Color(0XFF999999)),
                    ),
                    Text(
                      '$updatedat',
                      style: TextStyle(fontSize: 14, color: Color(0XFF0F172B)),
                    ),
                  ],
                ),
              ],
            ),
          ),
          GestureDetector(
            onTap: () {
              Get.offNamed('/user/assets');
            },
            child: Container(
              margin: EdgeInsets.symmetric(horizontal: 15, vertical: 50),
              height: 50,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                color: Color(0XFF0F172B),
                borderRadius: BorderRadius.circular(25),
              ),
              child: Text(
                '确认',
                style: TextStyle(fontSize: 16, color: Color(0XFFFFFFFF)),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
